//
//  ViewController.m
//  2015.11.5  w1
//
//  Created by blue on 15-11-5.
//  Copyright (c) 2015年 sxh. All rights reserved.
//

#import "ViewController.h"

#import "TestViewController.h"

#import "TableViewController.h"

@interface ViewController ()
{
    UILabel *l;
    
}
@end


@interface ViewController ()

@end

@implementation ViewController

- (void)viewDidLoad
{
    [super viewDidLoad];
	// Do any additional setup after loading the view, typically from a nib.
    
    self.title=@"会议记录本";
    
    self.view.backgroundColor = [UIColor brownColor];
    
    
//    l = [UILabel new];
//    l.text = @"你好！苏苏";
//    
//    [l sizeToFit];
//    l.center = CGPointMake(self.view.frame.size.width/2.0, self.view.frame.size.height/2.0);
//    l.textColor = [UIColor blueColor];
//    [self.view addSubview:l];
    
    UIButton *btn1 = [UIButton buttonWithType:UIButtonTypeRoundedRect];
    btn1.frame = CGRectMake(20, 100, 100, 44);
    [btn1 setTitle:@"查看记录" forState:UIControlStateNormal];
    [btn1 setTitleColor:[UIColor blackColor] forState:UIControlStateNormal];
    
    [btn1 addTarget:self action:@selector(onkuan:) forControlEvents:UIControlEventTouchUpInside];
    [btn1 addTarget:self action:@selector(onClick:) forControlEvents:UIControlEventTouchUpInside];
    [self.view addSubview:btn1];
    
    
    UIButton *btn2 = [UIButton buttonWithType:UIButtonTypeRoundedRect];
    btn2.frame = CGRectMake(20, 200, 100, 44);
    [btn2 setTitle:@"添加记录" forState:UIControlStateNormal];
    [btn2 setTitleColor:[UIColor blackColor] forState:UIControlStateNormal];
    
    [btn2 addTarget:self action:@selector(onkuan:) forControlEvents:UIControlEventTouchUpInside];
    [btn2 addTarget:self action:@selector(onClick:) forControlEvents:UIControlEventTouchUpInside];
    [self.view addSubview:btn2];

}

-(void)onkuan:(id)sender
{
    UIView *view=[[UIView alloc] initWithFrame:CGRectMake(20, 200, 200, 200)];
    view.layer.borderWidth=2;
    view.clipsToBounds=YES;
    [self.view addSubview:view];
    
}


-(void)onClick:(id)sender
{
    
    
    
    TableViewController *con = [TableViewController new];
    [self.navigationController pushViewController:con animated:YES];
    
}





-(void)viewDidAppear:(BOOL)animated{
    [super viewDidAppear:animated];
    [UIView animateWithDuration:1.6 animations:^{l.center = CGPointMake(self.view.frame.size.width/5.9, self.view.frame.size.height - 44);}];
    
    
    
}




- (void)didReceiveMemoryWarning
{
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

@end
